<template>
  <div>
    <table border="1" cellspacing="0">
      <thead>
        <tr>
          <th v-for="(value,index) in header" :key="index">
            <template>
              <span v-if="value.title == 'index'">{{'index'}}</span>
              <input v-else-if="value.title=='check'" type="checkbox" />
              <span v-else-if="value.title=='button'">操作</span>
              <span v-else>{{value.ming}}</span>
            </template>
          </th>
        </tr>
      </thead>
      <tbody>
        <tr v-for="(v,i) in tableData" :key="i">
          <td v-for="(value,index) in header" :key="index">
            <template>
              <span v-if="value.title=='index'">{{i+1}}</span>
              <input v-else-if="value.title=='check'" type="checkbox" />
              <span v-else-if="value.title=='button'">
                <slot name="del" :index='i' :item='v'/>
              </span>
              <span v-else>{{v[value.title]}}</span>
            </template>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</template>

<script>
export default {
    props:['tableData','header'],
  data() {
    return {
    };
  },
  mounted(){
     
  },
  methods:{}
  
  
};
</script>

<style scoped>
table {
  width: 100%;
  text-align: center;
  margin-top: 20px;
}


</style>